Giter VIP home page Giter VIP logo

nomino's People

Contributors

dnaka91 avatar micwoj92 avatar yaa110 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nomino's Issues

Unwelcomed `_` when zero-padding filenames

Hey Navid,
let me start by expressing my gratitude for your efforts into this nice project !

A frequent use case of mine is to rename a set of numbered files / directories by padding them with zeroes, and Nomino seems best suited for this.

Unfortunately, it insists in renaming some paths when there's no need to.

Take the following example:

d="$(mktemp -d)"
mkdir -p "$d/{1,5,10} - Whatever"
nomino --dir "$d" --print --test '(\d+)(.*)' '{:2}{}'
rmdir "$d"/* ; rmdir "$d"

which outputs

+---------------+----------------+
| Input         | Output         |
+---------------+----------------+
| 1 - Whatever  | 01 - Whatever  |
| 5 - Whatever  | 05 - Whatever  |
| 10 - Whatever | _10 - Whatever |
+---------------+----------------+

whereas I'd expect to get

+---------------+----------------+
| Input         | Output         |
+---------------+----------------+
| 1 - Whatever  | 01 - Whatever  |
| 5 - Whatever  | 05 - Whatever  |
| 10 - Whatever | 10 - Whatever |
+---------------+----------------+

Could you please consider solving this ?

Cheers, and best wished for this end of year !

\d not works on Windows

nomino 1.2.2 on Windows 10 21h2 x64
files in the current dir:
1.txt 2.txt ... 10.txt
nomino -tp "(\d+).txt" "{:2}.txt" (not work)
nomino -tp "([0-9]+).txt" "{:2}.txt" (works)

AUR packaging dependency

Describe the bug

According to Rust package guidelines, Rust packages on the AUR should declare makedepends=('cargo') instead of makedepends=('rust'). This allows rustup's installed toolchains to be picked up and makes the makepkg -dsi workaround unnecessary.

I saw that you maintain the AUR package yourself so I thought I'd report the issue here.

Missing error messages

Describe the bug
When not having write permissions to files, nomino fails silently

Command

➜ nomino -er "(\d).(.*)" "{}-{}"

Expected
An error message that it could not do what it tried to do. (Running the same command with sudo (obviously) worked)

Command map file (create using -g option)

{
doesnt matter
}

Expected map file

{
tables print fine as expected
}

Version (nomino -V)
nomino 0.4.3

Environment

  • OS: FreeBSD 12.1-RELEASE-p10 GENERIC amd64

Add support for creating links/symlinks insted of renaming

Is your feature request related to a problem? Please describe.
I'm downloading torrents and I want them to keep seeding but at the same time I want to have correctly named files

Describe the solution you'd like
I would like to have a flag like -s or -h to create symlinks or to create links similar to what the rename utility has

Consider cross-platform support\builds

You should consider making this a cross-platform tool (which should be fairly easy to accomplish being in go).

Having builds available for Windows and Mac would expand the potential user base a great deal.

Add a flag to select the printed format

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                  

More nests and recursion

Describe the bug
Given the following nested hierarchy:

start_dir
├── a
├── b
├── c
│   ├── cc1
│   └── cc2
└── u
    ├── uu1
    └── uu2

nomino's recursion goes only 1 level deep.

Command

➜  nomino -tpkr ".*/(.*)/(.*)" "start_{}_{}"

This should create start_c_cc1,start_c_cc2,start_u_uu1,start_u_uu2
Instead, nomino stops looking at items located in c and u folders.

Version (nomino -V)
nomino 0.3.1

Environment

  • OS: Linux 5.6.4

Allow manually specifying search depth

Is your feature request related to a problem? Please describe.
([^/]*)/.* would search one more depth than I expect.

Regex::new(pattern)?,
pattern.chars().filter(|c| *c == MAIN_SEPARATOR).count() + 1,

Describe the solution you'd like
Add a --max-depth and/or --depth option to control search depth of subdirectories.

Replace all substrings

Is your feature request related to a problem? Please describe.
I was impressed by the benchmark results and gave nomino a try. It looks like nomino needs a regex pattern of the full string (file path). Most of the time I will just need to replace sub strings in file names but not those in the directory names. E.g., replace all hyphen with space.

Describe the solution you'd like
I might not be aware of it, but has nomino something similar to rnr's sed like solution? rnr -f -r -l0 "pattern" "replacement"

Add support for subdirectories

First, thanks for the work you've put into this project. I find it really handy. ;)

Is your feature request related to a problem? Please describe.
I think your project could benefit from letting the user also recurse into subdirectories

For, instance, one could replace a whole subtree-structure as follows:

➜ nomino -p -r "(.*)/(.*)/(.*)" "{} {}.{}"

Could restore your default structure

Nomino (2020) S1.E1.1080p.mkv
Nomino (2020) S1.E2.1080p.mkv
Nomino (2020) S1.E3.1080p.mkv
Nomino (2020) S1.E4.1080p.mkv
Nomino (2020) S1.E5.1080p.mkv

from, let's say a structure like this:

Nomino (2020)/S1/E1.1080p.mkv
Nomino (2020)/S1/E2.1080p.mkv
Nomino (2020)/S1/E3.1080p.mkv
Nomino (2020)/S1/E4.1080p.mkv
Nomino (2020)/S1/E5.1080p.mkv

Describe the solution you'd like
I would recommend that recursion is disabled by default, however, if a / is used, it is turned on automatically. Recursion depth should be an option in the cli as well.

Additional context

Best,
da-h

Add support of files lists

It would be great to be able to feed nomino a .txt with a list of files which need renaming (full paths, one path per line).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.