00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "osdep/osdep.h"
00022
00023 #include <string>
00024 #include "encoder_usage.h"
00025
00026 using namespace std;
00027
00028 EncoderUsage::EncoderUsage()
00029 {
00030 add(UsageDescriptor(
00031 ARG_HELP,
00032 "h",
00033 "help",
00034 UsageDescriptor::possible,
00035 "DEVICE",
00036 "Print this message.",
00037 UsageDescriptor::command
00038 ));
00039
00040
00041 add(UsageDescriptor(
00042 ARG_CMD_ENCODE,
00043 "e",
00044 "encode",
00045 UsageDescriptor::required,
00046 "PASSWORD",
00047 string("Encode the input file with PASSWORD and save it to output file.")
00048 + string("\n\tPASSWORD has to be provided as string of two hex digits per byte (like 01202040ac)."),
00049 UsageDescriptor::command
00050 ));
00051
00052 add(UsageDescriptor(
00053 ARG_CMD_DECODE,
00054 "d",
00055 "decode",
00056 UsageDescriptor::required,
00057 "PASSWORD",
00058 string("Decode the input file with PASSWORD and save it to output file.")
00059 + string("\n\tPASSWORD has to be provided as string of two hex digits per byte (like 01202040ac)."),
00060 UsageDescriptor::command
00061 ));
00062 add(UsageDescriptor(
00063 ARG_CMD_CONVERT,
00064 "c",
00065 "convert",
00066 UsageDescriptor::absent,
00067 "",
00068 "Convert the file from one format to enother.",
00069 UsageDescriptor::command
00070 ));
00071
00072
00073 add(UsageDescriptor(
00074 ARG_INPUT_HEX,
00075 "ix",
00076 "input_hex",
00077 UsageDescriptor::required,
00078 "FILE_NAME",
00079 "Input file in Intel Hex Format.",
00080 UsageDescriptor::option
00081 ));
00082
00083 add(UsageDescriptor(
00084 ARG_INPUT_BIN,
00085 "ib",
00086 "input_bin",
00087 UsageDescriptor::required,
00088 "FILE_NAME",
00089 "Input file in Binary Format.",
00090 UsageDescriptor::option
00091 ));
00092
00093 add(UsageDescriptor(
00094 ARG_INPUT_DATA,
00095 "id",
00096 "input_data",
00097 UsageDescriptor::required,
00098 "DATA",
00099 string("Immediate mode - actual byte(s) specified in the command line")
00100 + string("\n\tas string of two hex digits per byte (like 01202040ac)."),
00101 UsageDescriptor::option
00102 ));
00103
00104 add(UsageDescriptor(
00105 ARG_OUTPUT_HEX,
00106 "ox",
00107 "output_hex",
00108 UsageDescriptor::required,
00109 "FILE_NAME",
00110 "Output file in Intel Hex Format.",
00111 UsageDescriptor::option
00112 ));
00113
00114 add(UsageDescriptor(
00115 ARG_OUTPUT_BIN,
00116 "ob",
00117 "output_bin",
00118 UsageDescriptor::required,
00119 "FILE_NAME",
00120 "Output file in Binary Format.",
00121 UsageDescriptor::option
00122 ));
00123
00124 }