Skip to content

summarize CLI inconsistent with other subcommands #359

@keighrim

Description

@keighrim

Bug Description

The summarize CLI module currently deviates from the patterns found in other CLI tools like, regarding the I/O arguments. It uses a mandatory -i flag for input instead of a positional argument, requires an output path via -o instead of defaulting to STDOUT, and lacks a long-form flag names. I;m proposing aligning summarize with these conventions to provide consistent user experience across the command-line interface.

Feature describe / rewind / source summarize
Input Positional (supports STDIN) Flagged (-i, required)
Output -o, --output (optional, defaults to STDOUT) -o (required flag, no long-form)
Pretty-print -p, --pretty Not implemented

Reproduction steps

summarize help says

$ mmif summarize --help
usage: mmif summarize [-h] -i MMIF_FILE -o OUTPUT_FILE

Create a JSON Summary for a MMIF file

options:
  -h, --help      show this help message and exit
  -i MMIF_FILE    input MMIF file
  -o OUTPUT_FILE  output JSON summary file

but others, for example rewind

$ mmif rewind --help
usage: mmif rewind [-h] [-o OUTPUT] [-p] [-n NUMBER] [-m {app,view}] [MMIF_FILE]

provides CLI to rewind a MMIF from a CLAMS workflow.

MMIF rewinder rewinds a MMIF by deleting the last N views.
N can be specified as a number of views, or a number of producer apps. 

positional arguments:
  MMIF_FILE             input MMIF file path, or STDIN if `-` or not provided.

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        output file path, or STDOUT if not provided.
  -p, --pretty          Pretty-print rewound MMIF
  -n NUMBER, --number NUMBER
                        Number of views or apps to rewind, must be a positive integer. If 0, the user will be prompted to choose. (default: 0)
  -m {app,view}, --mode {app,view}
                        Choose to rewind by number of views or number of producer apps. (default: view)

Expected behavior

No response

Log output

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛BSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions