Skip to content

Several improvements #14

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Several improvements #14

wants to merge 7 commits into from

Conversation

bbukh
Copy link

@bbukh bbukh commented Sep 13, 2022

  • Quiet option to suppress the log messages
  • More usage help
  • A bit of error-handling and paranoia
  • An option to save the list of uploaded files and their UUIDs to a file

One thing that I would have preferred is to have the "-r|--restart" option to force the restart, as opposed to the current toggle behavior. However, I kept the old behavior for backwards-compatibility.

echo "usage: $(basename $0) [options] path-to-file [path-to-file]..."
echo " -h --help print this usage information and exit"
echo " -q --quiet don't print progress information"
echo " -r --toggle-restart toggle whether to restart the tablet (default is given by RESTART_XOCHITL_DEFAULT)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"toggle-restart" and "restart the tablet" could be confusing/misleading, since systemctl restart xochitl is just restarting the UI service and not rebooting the tablet. for many people "restarting" a device is a reboot or power cycle.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. What do you suggest instead? Saying "restart the tablet's UI" would be accurate but unenlightening, as it does not explain the purpose behind the restart. One could say "refresh the document database on the tablet" but does not explain that the whole UI will refresh.

Copy link

@bennetyee bennetyee Sep 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm just doing a drive-by comment since it's really up to @adaerr -- but FWIW i'd say that rather be technically-correct (but possibly confusing), be user-focused and use terminology that explains the effects visible to the user rather than how it's accomplished. so my suggestion is something like --make-visible or --show-docs-now or something along those lines, and the extended help comment would explain by saying "make the transferred document visible in the UI now (rather than after next reboot / xfer with --make-visible)" or something similar.

Copy link
Author

@bbukh bbukh Sep 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestions. I feel that it would still be quite weird to have -r short options to expand to --toggle-make-visible, and the latter is quite a mouthful. And we must have -r be named -r and act as a toggle, or we break backward-compatibility. I leave to @adaerr to make the final call.

}


# Parse arguments

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would using getopt(1) be easier? or are there linux/osx compatibility issues?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not aware of getopt(1). Looking at the docs now, it indeed could have saved a little bit of work. I will not attempt change to getopt(1), as it does not seem to offer huge advantages. However, I will keep it in mind when I write argument-parsing next time.

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.

2 participants