diff --git a/src/sourmash/cli/sig/describe.py b/src/sourmash/cli/sig/describe.py index e07b3204aa..79833da9a8 100644 --- a/src/sourmash/cli/sig/describe.py +++ b/src/sourmash/cli/sig/describe.py @@ -11,6 +11,10 @@ def subparser(subparsers): '-q', '--quiet', action='store_true', help='suppress non-error output' ) + subparser.add_argument( + '-d', '--debug', action='store_true', + help='provide debugging output' + ) subparser.add_argument( '--csv', metavar='FILE', help='output information to a CSV file' diff --git a/src/sourmash/sig/__main__.py b/src/sourmash/sig/__main__.py index 08d7be9e44..df1ce1c3dc 100644 --- a/src/sourmash/sig/__main__.py +++ b/src/sourmash/sig/__main__.py @@ -202,7 +202,7 @@ def describe(args): """ provide basic info on signatures """ - set_quiet(args.quiet) + set_quiet(args.quiet, args.debug) moltype = sourmash_args.calculate_moltype(args) picklist = sourmash_args.load_picklist(args) pattern_search = sourmash_args.load_include_exclude_db_patterns(args) @@ -287,7 +287,8 @@ def manifest(args): loader = sourmash_args.load_file_as_index(args.location, yield_all_files=args.force) except ValueError as exc: - error(f"Cannot open '{args.location}'.") + error(f"Cannot open '{args.location}' as a sourmash signature collection.") + error("Use -d/--debug for details.") sys.exit(-1) rebuild = True @@ -1193,6 +1194,7 @@ def kmers(args): _SketchInfo = namedtuple('_SketchInfo', 'ksize, moltype, scaled, num, abund') +# NOTE: also aliased as 'summarize' def fileinfo(args): """ provide summary information on the given path (collection, index, etc.) @@ -1209,7 +1211,8 @@ def fileinfo(args): idx = sourmash_args.load_file_as_index(args.path, yield_all_files=args.force) except ValueError: - error(f"Cannot open '{args.path}'.") + error(f"Cannot open '{args.path}' as a sourmash signature collection.") + error("Use -d/--debug for details.") sys.exit(-1) print_bool = lambda x: "yes" if x else "no" diff --git a/tests/test_cmd_signature.py b/tests/test_cmd_signature.py index 2ce7ea5766..2168cd9555 100644 --- a/tests/test_cmd_signature.py +++ b/tests/test_cmd_signature.py @@ -3572,7 +3572,7 @@ def test_sig_manifest_does_not_exist(runtmp): runtmp.run_sourmash('sig', 'manifest', 'does-not-exist', '-o', 'out.csv') - assert "Cannot open 'does-not-exist'." in runtmp.last_result.err + assert "Cannot open 'does-not-exist' as a sourmash signature collection." in runtmp.last_result.err def test_sig_manifest_7_allzip_1(runtmp): diff --git a/tests/test_cmd_signature_fileinfo.py b/tests/test_cmd_signature_fileinfo.py index cf6155f036..a0847fe97a 100644 --- a/tests/test_cmd_signature_fileinfo.py +++ b/tests/test_cmd_signature_fileinfo.py @@ -329,4 +329,4 @@ def test_sig_fileinfo_does_not_exist(runtmp): with pytest.raises(SourmashCommandFailed): runtmp.run_sourmash('sig', 'fileinfo', 'does-not-exist') - assert "Cannot open 'does-not-exist'." in runtmp.last_result.err + assert "Cannot open 'does-not-exist' as a sourmash signature collection" in runtmp.last_result.err