Problem
mpqcli --help | grep file | cut -d' ' -f3 | # any subcommand that
while read -r subcommand # interacts with files
do mpqcli $subcommand --help | grep 'mpqcli'
done
mpqcli create [OPTIONS] target
mpqcli add [OPTIONS] archive files...
mpqcli remove [OPTIONS] archive files...
mpqcli list [OPTIONS] target
mpqcli extract [OPTIONS] target
mpqcli read [OPTIONS] file target
Sometimes files are after archive,
sometimes before,
sometimes as option,
sometimes multiple,
sometimes only one.
Proposed solution
archive files... is my favorite.
Lots of these can be solved with more knowledge of CLI:
create only accepts 1 file
- would be
mpqcli create [OPTIONS] <dir | file [files...]>
- But you can create a temp dir and place multiple files inside
list will print all files
- would be
mpqcli read [OPTIONS] <archive> [pattern]
- But you can grep it
extract requires --file option at most 1
- would be
mpqcli extract [OPTIONS] <archive> [files...]
read is the opposite order of add and remove, making it single file only
- would be
mpqcli read [OPTIONS] <archive> <file> [files...]
- How would multiple files read? Like
cat *.txt or like grep . *.txt?
Additionally, convert all / to \
Example: mpqcli extract archive.mpq scripts/*.txt sounds/surfthe.wav
But maybe I'm wrong on this point, as you can get the filenames with list and pipe grep xargs and stuff.
Additional context
No response
Problem
Sometimes files are after archive,
sometimes before,
sometimes as option,
sometimes multiple,
sometimes only one.
Proposed solution
archive files...is my favorite.Lots of these can be solved with more knowledge of CLI:
createonly accepts 1 filempqcli create [OPTIONS] <dir | file [files...]>listwill print all filesmpqcli read [OPTIONS] <archive> [pattern]extractrequires--fileoption at most 1mpqcli extract [OPTIONS] <archive> [files...]readis the opposite order ofaddandremove, making it single file onlympqcli read [OPTIONS] <archive> <file> [files...]cat *.txtor likegrep . *.txt?Additionally, convert all
/to\Example:
mpqcli extract archive.mpq scripts/*.txt sounds/surfthe.wavBut maybe I'm wrong on this point, as you can get the filenames with
listand pipe grep xargs and stuff.Additional context
No response