diff --git a/README.md b/README.md index bf6540b..5f16e3b 100644 --- a/README.md +++ b/README.md @@ -335,6 +335,8 @@ The `--mode` option can be used to change the run mode. Four run modes are avail By default, informational output is sent to the standard output (normally the terminal console). The option `--log-dest` can be used to send the output to the given destination instead. The value can be `-` (i.e., a dash) to indicate console output, or it can be a file path to send the output to the file. A special exception is that even if a log destination is given, IGA will still print the final record URL to stdout. This makes it possible to invoke IGA from scripts that capture the record URL while still saving diagnostic output in case debugging is needed. +By default, IGA prints only the record URL when done. The option `--print-doi` will make it also print the DOI of the record. (Note that this only works when publishing records; if options `--draft` or `--community` are used, then there will be no DOI. In those case, only the URL will be printed.) + Reading and writing large files may take a long time; on the other hand, IGA should not wait forever on network operations before reporting an error if a server or network becomes unresponsive. To balance these conflicting needs, IGA automatically scales its network timeout based on file sizes. To override its adaptive algorithm and set an explicit timeout value, use the option `--timeout` with a value in seconds. If given the `--version` option, this program will print its version and other information, and exit without doing anything else. @@ -356,7 +358,6 @@ As explain above, IGA takes one required argument on the command line: either (1 | `--github-repo` _R_ | `-r` _R_ | Look in GitHub repository _R_ of account _A_ | Get repo name from release URL | ✯ | | `--github-token` _T_ | `-t` _T_ | Use GitHub access token _T_| Use value in env. var. `GITHUB_TOKEN` | | | `--help` | `-h` | Print help info and exit | | | -| `--print-doi` | `-i` | Print both the DOI & record URL when done | Print only the record URL | | | `--invenio-server` _S_ | `-s` _S_ | Send record to InvenioRDM server at address _S_ | Use value in env. var. `INVENIO_SERVER` | | | `--invenio-token` _K_ | `-k` _K_ | Use InvenioRDM access token _K_ | Use value in env. var. `INVENIO_TOKEN` | | | `--list-communities` | `-L` | List communities available for use with `--community` | | | @@ -364,6 +365,7 @@ As explain above, IGA takes one required argument on the command line: either (1 | `--mode` _M_ | `-m` _M_ | Run in mode `quiet`, `normal`, `verbose`, or `debug` | `normal` | | | `--open` | `-o` | Open record's web page in a browser when done | Do nothing when done | | | `--parent-record` _N_ | `-p` _N_ | Make this a new version of existing record _N_ | New record is unrelated to other records | ❖ | +| `--print-doi` | `-i` | Print both the DOI & record URL when done | Print only the record URL | | | `--read-metadata` _R_ | `-R` _R_ | Read metadata record from file _R_; don\'t build one | Build metadata record | | | `--save-metadata` _D_ | `-S` _D_ | Save metadata record to file _D_; don\'t upload it | Upload to InvenioRDM server | | | `--timeout` _X_ | `-T` _X_ | Wait on network operations a max of _X_ seconds | Auto-adjusted based on file size | | diff --git a/action.yml b/action.yml index 2771490..57e0b58 100644 --- a/action.yml +++ b/action.yml @@ -84,7 +84,7 @@ runs: - name: Install IGA. shell: bash run: | - python -m pip install https://github.com/caltechlibrary/iga/archive/develop.zip + python -m pip install iga - name: Find out the latest release tag for this repo. shell: bash diff --git a/docs/cli-usage.md b/docs/cli-usage.md index c379c70..4b7aa26 100644 --- a/docs/cli-usage.md +++ b/docs/cli-usage.md @@ -117,7 +117,6 @@ As explain above, IGA takes one required argument on the command line: either (1 | `--github-repo` _R_ | `-r` _R_ | Look in GitHub repository _R_ of account _A_ | Get repo name from release URL | ✯ | | `--github-token` _T_ | `-t` _T_ | Use GitHub access token _T_| Use value in env. var. `GITHUB_TOKEN` | | | `--help` | `-h` | Print help info and exit | | | -| `--print-doi` | `-i` | Print both the DOI & record URL when done | Print only the record URL | | | `--invenio-server` _S_ | `-s` _S_ | Send record to InvenioRDM server at address _S_ | Use value in env. var. `INVENIO_SERVER` | | | `--invenio-token` _K_ | `-k` _K_ | Use InvenioRDM access token _K_ | Use value in env. var. `INVENIO_TOKEN` | | | `--list-communities` | `-L` | List communities available for use with `--community` | | | @@ -125,6 +124,7 @@ As explain above, IGA takes one required argument on the command line: either (1 | `--mode` _M_ | `-m` _M_ | Run in mode `quiet`, `normal`, `verbose`, or `debug` | `normal` | | | `--open` | `-o` | Open record's web page in a browser when done | Do nothing when done | | | `--parent-record` _N_ | `-p` _N_ | Make this a new version of existing record _N_ | New record is unrelated to other records | ❖ | +| `--print-doi` | `-i` | Print both the DOI & record URL when done | Print only the record URL | | | `--read-metadata` _R_ | `-R` _R_ | Read metadata record from file _R_; don\'t build one | Build metadata record | | | `--save-metadata` _D_ | `-S` _D_ | Save metadata record to file _D_; don\'t upload it | Upload to InvenioRDM server | | | `--timeout` _X_ | `-T` _X_ | Wait on network operations a max of _X_ seconds | Auto-adjusted based on file size | | diff --git a/iga/cli.py b/iga/cli.py index 9d277cb..7c12097 100644 --- a/iga/cli.py +++ b/iga/cli.py @@ -377,9 +377,6 @@ def _list_communities(ctx, param, value): # @click.help_option('--help', '-h', help='Show this help message and exit') # -@click.option('--print-doi', '-i', 'print_doi', is_flag=True, - help='Print the DOI in addition to the record URL') -# @click.option('--invenio-server', '-s', 'server', metavar='STR', callback=_read_server, help='InvenioRDM server address', is_eager=True) # @@ -403,6 +400,9 @@ def _list_communities(ctx, param, value): @click.option('--parent-record', '-p', 'parent_id', metavar='STR', help='Make this a new version of an existing record') # +@click.option('--print-doi', '-i', 'print_doi', is_flag=True, + help='Print the DOI in addition to the record URL') +# @click.option('--read-metadata', '-R', 'source', metavar='FILE', type=File('r'), help='Read metadata record from _FILE_; don\'t build one') #