Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-21889

CmdLineActivator reuses command-line argument options in different sub-commands

    Details

    • Story Points:
      2
    • Sprint:
      DB_F19_10
    • Team:
      Data Access and Database

      Description

      The one I'm particularly aware of is -t, which is used in one context for TIMEOUT and another for Tasks.  We should do a sweep for others.

      This may be best handled as part of an overall re-think of the command-line interface that maximizes consistency with other tools (DM-15257), but we should make sure to get it done one way or another.

        Attachments

          Issue Links

            Activity

            Hide
            salnikov Andy Salnikov added a comment - - edited

            There are more "recycled" options:

            • -p
              • global option (same as --package) is used to specify packages to search for modules/tasks
              • list sub-command uses -p option (--packages) to display the list of packages defined by global option (or default one)
              • build/qgraph/run sub-commands use -p option (--pipeline) to specify pipeline pickle file used as input
            • -o
              • global option (–output) defines name of the output collection
              • build/qgraph/run sub-commands use -o (--order-pipeline) to order tasks in pipeline
            • -d
              • global option (--data-query) defines used data selection expression
              • build/qgraph/run sub-commands use -d (--delete) to delete task from a pipeline
            • -t
              • global option (–timeout) specifies timeout for task execution in multi-process mode
              • list sub-command uses -t (--tasks)  to show the list of known Tasks 
              • build/qgraph/run sub-commands use -t (--task) to add a task to pipeline
            • -m
              • list sub-command uses -m (--modules) to show known modules
              • build/qgraph/run sub-commands use -m (--move) to manually re-order tasks in a pipeline
            • -l
              • list sub-command uses -l (--pipeline-tasks) to show the list of known PipelineTasks
              • build/qgraph/run sub-commands use -l (--label) to change task label
            Show
            salnikov Andy Salnikov added a comment - - edited There are more "recycled" options: -p global option (same as --package) is used to specify packages to search for modules/tasks list sub-command uses -p option (--packages) to display the list of packages defined by global option (or default one) build/qgraph/run sub-commands use -p option (--pipeline) to specify pipeline pickle file used as input -o global option (–output) defines name of the output collection build/qgraph/run sub-commands use -o (--order-pipeline) to order tasks in pipeline -d global option (--data-query) defines used data selection expression build/qgraph/run sub-commands use -d (--delete) to delete task from a pipeline -t global option (–timeout) specifies timeout for task execution in multi-process mode list sub-command uses -t (--tasks)  to show the list of known Tasks  build/qgraph/run sub-commands use -t (--task) to add a task to pipeline -m list sub-command uses -m (--modules) to show known modules build/qgraph/run sub-commands use -m (--move) to manually re-order tasks in a pipeline -l list sub-command uses -l (--pipeline-tasks) to show the list of known PipelineTasks build/qgraph/run sub-commands use -l (--label) to change task label
            Hide
            salnikov Andy Salnikov added a comment - - edited

            I think best approach here would be to keep single-letter options for the most frequently used cases and use long options for other cases (but I should check that there are no recycled long options too). What I want to do:

            • list command should drop all single-letter options and only use long ones
            • timeout option should do that too

            This only leaves us with -p, -o, and -d and I'm not sure which cases are more frequently used. I'd opt for keeping -p for global case (--packages) and use a different single-letter option for --pipeline (-r is unused). --order-pipeline should not be used much, so I can drop -o for that. -d is certainly used a lot for data query, should keep it there, but --delete is probably not used much. I think in general pipeline-editing options (move/delete/label) are not too useful, should drop single-letter options for those.

            Show
            salnikov Andy Salnikov added a comment - - edited I think best approach here would be to keep single-letter options for the most frequently used cases and use long options for other cases (but I should check that there are no recycled long options too). What I want to do: list command should drop all single-letter options and only use long ones timeout option should do that too This only leaves us with -p, -o, and -d and I'm not sure which cases are more frequently used. I'd opt for keeping -p for global case (--packages) and use a different single-letter option for --pipeline (-r is unused). --order-pipeline should not be used much, so I can drop -o for that. -d is certainly used a lot for data query, should keep it there, but --delete is probably not used much. I think in general pipeline-editing options (move/delete/label) are not too useful, should drop single-letter options for those.
            Hide
            salnikov Andy Salnikov added a comment -

            This is a small change but it breaks interface (I need to post something on community when this merges). May plan is to do this change, then DM-21890 which is very likely to be incompatible change too (maybe its better to merge these two tickets at once). Then I want to do refactoring in DM-15257 and hopefully that last part will not break interface.

            Show
            salnikov Andy Salnikov added a comment - This is a small change but it breaks interface (I need to post something on community when this merges). May plan is to do this change, then DM-21890 which is very likely to be incompatible change too (maybe its better to merge these two tickets at once). Then I want to do refactoring in DM-15257 and hopefully that last part will not break interface.
            Hide
            salnikov Andy Salnikov added a comment -

            Jim Bosch, I pushed second commit on the same branch/PR and it should be ready for review now. Changes are all rather trivial, but I started refactoring things so there is a lot of code re-shuffling in cmdLineParser module.

            Show
            salnikov Andy Salnikov added a comment - Jim Bosch , I pushed second commit on the same branch/PR and it should be ready for review now. Changes are all rather trivial, but I started refactoring things so there is a lot of code re-shuffling in cmdLineParser module.
            Hide
            salnikov Andy Salnikov added a comment -

            After rebasing to current master with DM-21421 things changed a little bit. DM-21421 removed global -p option and "list" sub-command entirely. I decided to use -p short option for --pipeline, feels more natural than -r.

            Show
            salnikov Andy Salnikov added a comment - After rebasing to current master with DM-21421 things changed a little bit. DM-21421 removed global -p option and "list" sub-command entirely. I decided to use -p short option for --pipeline, feels more natural than -r.

              People

              • Assignee:
                salnikov Andy Salnikov
                Reporter:
                jbosch Jim Bosch
                Reviewers:
                Jim Bosch
                Watchers:
                Andy Salnikov, Jim Bosch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel