Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a flag to select the printed format #11

Open
juarezr opened this issue Jun 18, 2021 · 0 comments
Open

Add a flag to select the printed format #11

juarezr opened this issue Jun 18, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@juarezr
Copy link

juarezr commented Jun 18, 2021

Is your feature request related to a problem? Please describe.

I loved nomino pragmatic approach to renaming files.

But I missing:

  • Printing output column aligned without table borders/headers/formating
  • Printing to markdown
  • Printing generated json to stdout

Describe the solution you'd like

Add some command-line options like:

USAGE:
    nomino [FLAGS] [OPTIONS] [[SOURCE] OUTPUT]...

FLAGS:
    -e, --extension    Preserves the extension of input files in 'sort' and 'regex' options
    -h, --help         Prints help information
    -k, --mkdir        Recursively creates all parent directories of '<OUTPUT>' if they are missing
    -w, --overwrite    Overwrites output files, otherwise, a '_' is prepended to filename
-    -p, --print        Prints the rename map as table to stdout
+    -p, --print        Prints the rename map as table to stdout
+    -l, --log          Prints the rename map as table to stderr
    -t, --test         Runs in test mode without renaming actual files (dry-run)
    -V, --version      Prints version information

OPTIONS:
        --depth <DEPTH>        Optional value to overwrite inferred subdirectory depth value in 'regex' mode
    -d, --dir <PATH>           Sets the working directory
    -g, --generate <PATH>      Stores a JSON map file in '<PATH>' after renaming files
+    -G, --gen-as [FMT]         Change stored file format to <FMT> [possible values: cols, csv, json, markdown, table]
+    -F, --format [FMT]         Change printed format to <FMT> [possible values: cols, csv, json, markdown, table]
    -m, --map <PATH>           Sets the path of map file to be used for renaming files
        --max-depth <DEPTH>    Optional value to set the maximum of subdirectory depth value in 'regex' mode
    -r, --regex <PATTERN>      Regex pattern (RE2 syntax) to match by filenames
    -s, --sort <ORDER>         Sets the order of natural sorting (by name) to rename files using enumerator [possible
                               values: ASC, DESC]

So command invocations like the bellow will print:

$ ls -l *.md
-rw-r--r--  1 root  root   4707 Jun 18 11:38 CODE_OF_CONDUCT.md
-rw-r--r--  1 root  root  10429 Jun 18 11:38 CONTRIBUTING.md
-rw-r--r--  1 root  root   4955 Jun 18 11:38 README.md
$$ nomino -pt -F cols '(.*)\.(md)' '{2}-{1}+{}'
CODE_OF_CONDUCT.md md-CODE_OF_CONDUCT+CODE_OF_CONDUCT
CONTRIBUTING.md    md-CONTRIBUTING+CONTRIBUTING      
README.md          md-README+README                  
@yaa110 yaa110 added the enhancement New feature or request label Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants