Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define basic command line interface #14

Merged
merged 2 commits into from
Dec 4, 2023
Merged

Define basic command line interface #14

merged 2 commits into from
Dec 4, 2023

Conversation

andreiled
Copy link
Owner

@andreiled andreiled commented Dec 4, 2023

  1. Split the downloader/configuration.ts file into several new files comprising a new top level configuration module.

  2. Define basic command line interface.

    1. Rename the downloader module to actions/download with the intent
      of placing future implementations of CLI actions under the actions top
      levle module.
    2. Use commander to define basic command line interface:
      • Default no-name command to download all new files from a specified removable drive.
      • init command to initialize a global configuration for this tool.

Manual Testing

  1. Build locally: npm run build.

  2. Run with various arguments and review the result.

    • $ node dist
      error: missing required argument 'drive-path'
      
    • $ node dist --help
      Usage: dist <drive-path>
      
      Download all new files from the specified removable drive (e.g. a memory card).
      Relies on the global configuration to identify supported directories on the removable drive and to determine where their contents should be saved.
      
      Arguments:
        drive-path  Removable drive (e.g. memory card) path
      
      Options:
        -h, --help  display help for command
      
      Commands:
        init        Initialize a global configuration
      
    • $ node dist init --help
      Usage: dist init [options]
      
      Initialize a global configuration
      
      Options:
        -h, --help  display help for command
      
    • $ node dist X:
      [X:] Found 1 supported directory: X:/DCIM
      [X:/DCIM] 101MSDCF is the latest previously processed sub-directory and could have new files: will process all sub-directories and files starting from it: 101MSDCF
      [X:/DCIM/101MSDCF] All sub-directories and/or files were processed before: ...
      

…omprising a new top level `configuration` module

This change is needed to prepare the code base for moving the rest of the `downloader` module to its new path.
1. Rename the `downloader` module to `actions/download` with the intent
   of placing future implementations of CLI actions under the `actions` top
   levle module.
2. Use `commander` to define basic command line interface:
    * Default _no-name_  command to download all new files from a specified removable drive.
    * `init` command to initialize a global configuration for this tool.
@andreiled andreiled merged commit f66917e into main Dec 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant