multiple

command module
v0.0.0-...-802325f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 1 Imported by: 0

README

Multiple

Build Status LICENSE Language Go Report Card CII Best Practices OpenSSF Scorecard Codecov CLOMonitor Release Tag

Overview

Multiple is an open-source command line tool, which can read input and separate into multiple subtasks to accelerate large scale jobs' execution.

Usage

Introduction
Usage: multiple.exe [options] -t "command template ..."
Available options:
  -h|--help                                         show this help
  --in=..., --in|-i <input>                         read each element from file or stdin
  --sep=..., --sep|-s <separator>                   separator for command and its arguments
  --cpu=..., --cpu|-n <number>                      number of CPU cores to use
  --template=..., --template|-t <command template>  command template to be executed
Batch rename files
find . -regex ".*\.jpg" | multiple -t 'mv {{.self}} {{trim ".jpg" .self}}.png'
Batch convert files' encoding
gci -r -fi "*.java.gbk" | multiple -t 'iconv -f GBK -t UTF8 -o {{trim .self|trim \".gbk\"}} {{trim .self}}'

Former command will find all .java.gbk files in current directory recursively, then convert them to .java files from encoding "GBK" to "UTF8".

Builtin functions
  • trim: Trim the prefix or suffix of a string.
  1. {{trim .self}} will trim all white spaces from a string.
  2. {{trim "pattern" .self}} will trim pattern from a string(both head and tail).
  3. {{trim "prefix" "suffix" .self}} will trim the prefix prefix and suffix suffix from a string.
  • add/sub/mul/div: Arithmetic operations.

License

Multiple is licensed under the MIT. For detail see LICENSE.

Note

The master branch may be in an unstable or even broken state during development. Please use releases instead of the master branch in order to get a stable set of binaries.

Star History

Star History Chart

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
multiple command
pkg
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL