vitiral/artifact

art ls + search did not behave intuitively

francois opened this issue · 3 comments

I really expected art ls auth to list any REQ, SPC, TST and RSK that pertain to authentication. Instead, I had quite a few errors:

$ art ls auth
ERROR: invalid artifact name: "auth"
Encountered Error:

invalid artifact name: "auth"

$ art ls -- auth
ERROR: invalid artifact name: "auth"
Encountered Error:

invalid artifact name: "auth"

$ art ls -p auth
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(CmdError("Unknown search fields in pattern: {\'h\', \'a\', \'u\', \'t\'}"), State { next_error: None })', /Users/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-mac/build/src/libcore/result.rs:868
note: Run with `RUST_BACKTRACE=1` for a backtrace.

$ art ls -p text auth
Encountered Error:

error: The value 'auth' was provided to '-p <FIELDS>', but it wasn't expecting any more values

USAGE:
    art ls -p <FIELDS>

For more information try --help

art help ls says that usage is art ls [FLAGS] [OPTIONS] [search], which is what art ls -p text auth means to me.

At the moment, I don't know how to search for artifacts that pertain to authentication. How is -p supposed to work? I can't find any documentation or examples from the CheatSheet.

Thanks for this issue! Sorry I've been delayed in replying, my son was just born :)

ls - p is what you are looking for. The error message should be improved.

I'll think about just making -p the default. Maybe add -e to mean "exact". I agree with you that most probably expect regex to be the default

so this is a documentation bug. Valid <FIELDS> are one or more of ADPOLT and correspond to -A, -D, etc. So to search in text you would use

art ls req -p T

I will document this better

I'm going to also allow for a comma separated list of lowercase long names, so that your example will work as well