summaryrefslogtreecommitdiff
path: root/src/bin/tyls.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-01 15:14:39 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-09-16 13:33:59 +0200
commitb038ed7ff6fa112fe8b8742b101445502ae89380 (patch)
treed06e6e774ca04ac3a049212671e31fa18cf92494 /src/bin/tyls.c
parent36a7166b7ac56aa53a885479a0aaf915893d630d (diff)
ty*: add unified --help / -h options to see a help page
This also adds documentation about the -h / --help options in the usages
Diffstat (limited to 'src/bin/tyls.c')
-rw-r--r--src/bin/tyls.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/bin/tyls.c b/src/bin/tyls.c
index 9bdd305..340101e 100644
--- a/src/bin/tyls.c
+++ b/src/bin/tyls.c
@@ -719,6 +719,19 @@ list_dir(const char *dir, Tyls_Options *options)
719 EINA_LIST_FREE(files, s) free(s); 719 EINA_LIST_FREE(files, s) free(s);
720} 720}
721 721
722static void
723print_usage(const char *argv0)
724{
725 printf("Usage: %s "HELP_ARGUMENT_SHORT" [-a] [-s|-m] FILE1 [FILE2 ...]\n"
726 "\n"
727 " -a Show hidden files\n"
728 " -s Small list mode\n"
729 " -m Medium list mode\n"
730 HELP_ARGUMENT_DOC"\n",
731 /*" -l Large list mode\n", Enable again once we support it */
732 argv0);
733}
734
722int 735int
723main(int argc, char **argv) 736main(int argc, char **argv)
724{ 737{
@@ -728,18 +741,8 @@ main(int argc, char **argv)
728 Tyls_Options options = {SMALL, EINA_FALSE}; 741 Tyls_Options options = {SMALL, EINA_FALSE};
729 742
730 ON_NOT_RUNNING_IN_TERMINOLOGY_EXIT_1(); 743 ON_NOT_RUNNING_IN_TERMINOLOGY_EXIT_1();
744 ARGUMENT_ENTRY_CHECK(argc, argv, print_usage);
731 745
732 if ((argc == 2) && (!strcmp(argv[1], "-h")))
733 {
734 printf("Usage: %s [-a] [-s|-m] FILE1 [FILE2 ...]\n"
735 "\n"
736 " -a Show hidden files\n"
737 " -s Small list mode\n"
738 " -m Medium list mode\n",
739 /*" -l Large list mode\n", Enable again once we support it */
740 argv[0]);
741 return 0;
742 }
743 eina_init(); 746 eina_init();
744#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) 747#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
745 ecore_app_no_system_modules(); 748 ecore_app_no_system_modules();