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

./link_workflow.sh -h does not return usage #1044

Closed
RussTreadon-NOAA opened this issue Oct 4, 2022 · 0 comments · Fixed by #1045 or #1046
Closed

./link_workflow.sh -h does not return usage #1044

RussTreadon-NOAA opened this issue Oct 4, 2022 · 0 comments · Fixed by #1045 or #1046
Labels
bug Something isn't working

Comments

@RussTreadon-NOAA
Copy link
Contributor

Expected behavior
./link_workflow.sh -h should return the usage section in the script.

Current behavior

Orion-login-3[82] rtreadon$ ./link_workflow.sh -h
+ RUN_ENVIR=EMC
+ OPTIND=1
+ getopts :ho option
+ case "${option}" in
+ usage
./link_workflow.sh: line 26: usage: command not found
Orion-login-3[83] rtreadon$

Machines affected
Only tested on Orion

To Reproduce

  1. clone g-w develop at 833b8f4
  2. cd sorc
  3. ./link_workflow.sh -h
@RussTreadon-NOAA RussTreadon-NOAA added the bug Something isn't working label Oct 4, 2022
WalterKolczynski-NOAA added a commit to WalterKolczynski-NOAA/global-workflow that referenced this issue Oct 4, 2022
The function being called when passed -h was not the same as the one
used for the function definition (there was a leading `_`).

Fixes NOAA-EMC#1044
WalterKolczynski-NOAA added a commit that referenced this issue Oct 4, 2022
The function being called when passed -h was not the same as the one
used for the function definition (there was a leading `_`).

Fixes #1044
WalterKolczynski-NOAA added a commit to WalterKolczynski-NOAA/global-workflow that referenced this issue Oct 4, 2022
WalterKolczynski-NOAA added a commit to WalterKolczynski-NOAA/global-workflow that referenced this issue Oct 4, 2022
WalterKolczynski-NOAA added a commit to WalterKolczynski-NOAA/global-workflow that referenced this issue Oct 5, 2022
Since removing the trace rendered the link script completely silent,
added some messages when it ends. A message reporting the successful
completion is added to the bottom. For errors, an ERR trap is added
that reports the error, along with the error code and line number.

Since UFS utils' `link_fixdirs.sh` turns the trace on, throw away its
STDERR. This isn't an ideal solution, but will do for now without
changes to UFS utils.

Also changed the case of `$RUN_ENVIR` to lowercase to match the
strings that are actually checked.

Refs: NOAA-EMC#1044
WalterKolczynski-NOAA added a commit that referenced this issue Oct 6, 2022
Removes the trace from the link script. Since this makes the script silent (including some errors), some messages are added to give feedback about the scripts success or failure.

UFS Utils' [link_fixdirs.sh](https://github.com/ufs-community/UFS_UTILS/blob/develop/fix/link_fixdirs.sh) script turns the trace on when it runs, so its STDERR is thrown away.

Also corrects a bug where the case of `$RUN_ENVIR` set did not match the case it was compared against.

Fixes #1044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant