diff --git a/cmd/commands/datasetArchiver.go b/cmd/commands/datasetArchiver.go index 660dc79..9e7d49a 100644 --- a/cmd/commands/datasetArchiver.go +++ b/cmd/commands/datasetArchiver.go @@ -15,14 +15,15 @@ import ( ) var datasetArchiverCmd = &cobra.Command{ - Use: "datasetArchiver [options] (ownerGroup | space separated list of datasetIds)", - Short: "Archives all datasets in state datasetCreated from a given ownerGroup", + Aliases: []string{"a", "archive"}, + Use: "datasetArchiver [options] (ownerGroup | space separated list of datasetIds)", + Short: "Archives all datasets in state datasetCreated from a given ownerGroup", Long: `Tool to archive datasets to the data catalog. You must choose either an ownerGroup, in which case all archivable datasets of this ownerGroup not yet archived will be archived. Or you choose a (list of) datasetIds, in which case all archivable datasets -of this list not yet archived will be archived. +of this list not yet archived will be archived. For further help see "` + MANUAL + `"`, Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/commands/datasetCleaner.go b/cmd/commands/datasetCleaner.go index 9de3e47..2cd54da 100644 --- a/cmd/commands/datasetCleaner.go +++ b/cmd/commands/datasetCleaner.go @@ -13,10 +13,11 @@ import ( ) var datasetCleanerCmd = &cobra.Command{ - Use: "datasetCleaner [options] datasetPid", - Short: "Remove dataset from archive and optionally from data catalog", + Aliases: []string{"c", "clean"}, + Use: "datasetCleaner [options] datasetPid", + Short: "Remove dataset from archive and optionally from data catalog", Long: `Tool to remove datasets from the data catalog. - + If Datablock entries exist for a given dataset, a reset job will be launched. If the Dataset should be removed from the data catalog, the corresponding diff --git a/cmd/commands/datasetGetProposal.go b/cmd/commands/datasetGetProposal.go index a6b8bbd..8cdf1db 100644 --- a/cmd/commands/datasetGetProposal.go +++ b/cmd/commands/datasetGetProposal.go @@ -14,10 +14,11 @@ import ( ) var datasetGetProposalCmd = &cobra.Command{ - Use: "datasetGetProposal [options] ownerGroup", - Short: "Returns the proposal information for a given ownerGroup", + Aliases: []string{"proposal"}, + Use: "datasetGetProposal [options] ownerGroup", + Short: "Returns the proposal information for a given ownerGroup", Long: `Tool to retrieve proposal information for a given ownerGroup. - + For further help see "` + MANUAL + `"`, Args: exactArgsWithVersionException(1), Run: func(cmd *cobra.Command, args []string) { diff --git a/cmd/commands/datasetIngestor.go b/cmd/commands/datasetIngestor.go index 8e2d39a..58cadb1 100644 --- a/cmd/commands/datasetIngestor.go +++ b/cmd/commands/datasetIngestor.go @@ -21,8 +21,9 @@ import ( ) var datasetIngestorCmd = &cobra.Command{ - Use: "datasetIngestor", - Short: "Define and add a dataset to the SciCat datacatalog", + Aliases: []string{"i", "ingest"}, + Use: "datasetIngestor", + Short: "Define and add a dataset to the SciCat datacatalog", Long: `Purpose: define and add a dataset to the SciCat datacatalog This command must be run on the machine having access to the data diff --git a/cmd/commands/datasetRetriever.go b/cmd/commands/datasetRetriever.go index 9676ec6..30f32c9 100644 --- a/cmd/commands/datasetRetriever.go +++ b/cmd/commands/datasetRetriever.go @@ -16,8 +16,9 @@ import ( ) var datasetRetrieverCmd = &cobra.Command{ - Use: "datasetRetriever (options) local-destination-path", - Short: "Retrieve datasets from intermediate cache, taking into account original sourceFolder names", + Aliases: []string{"r", "retrieve"}, + Use: "datasetRetriever (options) local-destination-path", + Short: "Retrieve datasets from intermediate cache, taking into account original sourceFolder names", Long: `Tool to retrieve datasets from the intermediate cache server of the tape archive to the destination path on your local system. diff --git a/cmd/commands/globusCheckTransfer.go b/cmd/commands/globusCheckTransfer.go index c86ec68..3f9967b 100644 --- a/cmd/commands/globusCheckTransfer.go +++ b/cmd/commands/globusCheckTransfer.go @@ -19,12 +19,13 @@ import ( ) var globusCheckTransfer = &cobra.Command{ - Use: "globusCheckTransfer [options] (transfer_task_id transfer_task_id ...)", - Short: "Checks whether a list of Globus transfers has finished", + Aliases: []string{"gct"}, + Use: "globusCheckTransfer [options] (transfer_task_id transfer_task_id ...)", + Short: "Checks whether a list of Globus transfers has finished", Long: `Tool for checking whether a list of Globus transfers has finished You must have a Globus account with access to the desired transfers. Optionally, -you can save +you can save For further help see "` + MANUAL + `"`, Args: minArgsWithVersionException(1), diff --git a/cmd/commands/waitForJobFinished.go b/cmd/commands/waitForJobFinished.go index b6aa4d2..a358a3c 100644 --- a/cmd/commands/waitForJobFinished.go +++ b/cmd/commands/waitForJobFinished.go @@ -17,10 +17,11 @@ import ( ) var waitForJobFinishedCmd = &cobra.Command{ - Use: "waitForJobFinished (options)", - Short: "Waits for job to be finished", - Long: `This script polls the status of a given job and returns when Job is finished`, - Args: cobra.NoArgs, + Aliases: []string{"w", "wait"}, + Use: "waitForJobFinished (options)", + Short: "Waits for job to be finished", + Long: `This script polls the status of a given job and returns when Job is finished`, + Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { // consts & vars var client = &http.Client{ diff --git a/migration_guide.md b/migration_guide.md index 30f44b6..33ce231 100644 --- a/migration_guide.md +++ b/migration_guide.md @@ -12,14 +12,16 @@ the new version. | Old command | New command | | -------------------------- | --------------- | -| datasetIngestor | scicat ingest | -| datasetRetriever | scicat retrieve | -| datasetArchiver | scicat archive | -| datasetCleaner | scicat clean | -| datasetGetProposal | scicat proposal | +| datasetIngestor | scicat-cli ingest | +| datasetRetriever | scicat-cli retrieve | +| datasetArchiver | scicat-cli archive | +| datasetCleaner | scicat-cli clean | +| datasetGetProposal | scicat-cli proposal | | datasetPublishData | _deprecated_ | | datasetPublishDataRetrieve | _deprecated_ | -| waitForJobFinished | scicat wait | +| waitForJobFinished | scicat-cli wait | + +Old commands are also valid aliases for subcommands (eg `scicat-cli datasetIngestor`). ## Command line options @@ -45,16 +47,7 @@ Both the old command using the `flags` parser and new command using the `cobra` ```diff - datasetIngestor metadata.json -+ scicat ingest metadata.json -``` - -#### Full ingestion command - -Note that `--autoarchive` is now default. - -```diff -- datasetIngestor -token $SCICAT_TOKEN -ingest -autoarchive metadata.json -+ scicat ingest --token $SCICAT_TOKEN --ingest metadata.json ++ scicat-cli ingest metadata.json ``` #### Ingestion with file listing @@ -63,7 +56,7 @@ Note that `--autoarchive` is now default. ```diff - datasetIngestor metadata.json filelisting.txt -+ scicat ingest --filelist filelisting.txt metadata.json ++ scicat-cli ingest --filelist filelisting.txt metadata.json ``` #### Multi-dataset ingestion using folder listing @@ -74,7 +67,7 @@ implemented with a short shell loop. ```diff - datasetIngestor metadata.json folderlisting.txt -+ while read folder; do scicat ingest --no-interactive -DsourceFolder="$folder" metadata.json; done