Skip to content

[Feature]: Update subcommands to be more consistent #180

Description

@MikaMika

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions