jdberry/tag

The item couldn’t be opened because the file name is invalid

jprokos opened this issue · 0 comments

If you could add this syntax example to your documentation to help others (although, it relies on gnu xargs). I haven't figured out how to pipe a list of filenames into tag using macOS installed xargs.

$ gxargs -d '\n' -a /Users/name/Desktop/textfile.txt -I % tag  -a red %

Here we use xargs to read from file (using -a), using replacing string with (using %) and execute command tag -a red {filename}. You may need to add -d '\n' (setting delimiter to newline) to split strings.

This allows us to use the two flags -d and -a there fore we don't need to add the -0 flag in xargs and tag.

-a file, --arg-file=file
Read items from file instead of standard input. If you use this option, stdin remains unchanged when commands are run. Otherwise, stdin is redirected
from /dev/null.
--delimiter=delim, -d delim
Input items are terminated by the specified character. The specified delimiter may be a single character, a C-style character escape such as \n, or an
octal or hexadecimal escape code. Octal and hexadecimal escape codes are understood as for the printf command. Multibyte characters are not supported.
When processing the input, quotes and backslash are not special; every character in the input is taken literally. The -d option disables any end-of-file
string, which is treated like any other argument. You can use this option when the input consists of simply newline-separated items, although it is al-
most always better to design your program to use --null where this is possible.

gnu xargs can be installed on mac using homebrew command brew install findutils