Changeset 8e16454 in mainline for uspace/app/tmon/main.c
- Timestamp:
- 2017-12-27T16:46:27Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4b83cc
- Parents:
- 59958992
- git-author:
- Petr Manek <petr.manek@…> (2017-12-27 16:43:34)
- git-committer:
- Petr Manek <petr.manek@…> (2017-12-27 16:46:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tmon/main.c
r59958992 r8e16454 42 42 #define INDENT " " 43 43 44 /** Command which is executed by tmon. */ 44 45 typedef struct tmon_cmd { 46 /** Unique name, by which the command is executed. */ 45 47 const char *name; 48 /** Description of the command, which is displayed in the usage string. */ 46 49 const char *description; 50 /** Function, which executes the command. Same as int main(int, char**). */ 47 51 int (*action)(int, char **); 48 52 } tmon_cmd_t; 49 53 54 /** Static array of commands supported by tmon. */ 50 55 static tmon_cmd_t commands[] = { 51 56 { … … 86 91 }; 87 92 93 /** Option shown in the usage string. */ 88 94 typedef struct tmon_opt { 95 /** Long name of the option without "--" prefix. */ 89 96 const char *long_name; 97 /** Short name of the option without "-" prefix. */ 90 98 char short_name; 99 /** Description of the option displayed in the usage string. */ 91 100 const char *description; 92 101 } tmon_opt_t; 93 102 103 /** Static array of options displayed in the tmon usage string. */ 94 104 static tmon_opt_t options[] = { 95 105 { … … 105 115 }; 106 116 117 /** Print usage string. 118 * @param[in] app_name Name to print in the invocation example. 119 */ 107 120 static void print_usage(char *app_name) 108 121 { … … 122 135 } 123 136 137 /** Main tmon entry point. 138 * @param[in] argc Number of arguments. 139 * @param[in] argv Argument values. Must point to exactly `argc` strings. 140 * 141 * @return Exit code 142 */ 124 143 int main(int argc, char *argv[]) 125 144 {
Note:
See TracChangeset
for help on using the changeset viewer.