@@ -31,9 +31,14 @@ the created flags:
3131```
3232.\cptool summaryhelp
3333 = cptool [flags]
34- --backupaddrlist: backup server address list
34+ -b, --backupaddrlist: backup server address list
35+ default:1.1.1.1,2.2.2.2
3536 -c, --configfile: working profile
3637 default:default.conf
38+ -f, --floatlist: list of numbers
39+ default:1.7,2.2,3.3
40+ --strlist: list of string
41+ default:a,bb,ccc
3742 --svraddr: server address to download the archive
3843 default:<nil>
3944 = cptool compress
@@ -87,12 +92,12 @@ the created flags:
8792 default:false
8893```
8994some parsing results:
90- ```
91- .\ cptool --svraddr 1.1.1.1 --backupaddrlist 2.2.2.2,2001:dead::1 compress -l 3 zipfile input1 out.zip
92- zipfile &{ConfigFile:default.conf SvrAddr:1.1.1.1 BackupAddrList:[2.2.2.2 2001:dead::1] Arg1: Compress:{Loop:3 Profile: Skip:false NoFlag: DryRun:{} ZipFolder:{FolderName: ArchiveName: CreationTime:2025-01-02 03:04:05 +0000 UTC} ZipFile:{FileName:input1 ArchiveName:out.zip}} Extract:{InputFile: OutputFolder:}}
95+ ```
96+ ./ cptool --svraddr 1.1.1.1 --backupaddrlist 2.2.2.2,2001:dead::1 compress -l 3 zipfile input1 out.zip
97+ zipfile &{ConfigFile:default.conf SvrAddr:1.1.1.1 BackupAddrList:[2.2.2.2 2001:dead::1] FloatList:[1.7 2.2 3.3] StrList:[a bb ccc] Compress:{Loop:3 Profile: Skip:false NoFlag: DryRun:{} ZipFolder:{FolderName: ArchiveName: CreationTime:2025-01-02 03:04:05 +0000 UTC} ZipFile:{FileName:input1 ArchiveName:out.zip}} Extract:{InputFile: OutputFolder:}}
9398
9499.\cptool compress zipfolder folder1 out.zip "2030 01 Jun 13:01" -l 99
95- zipfolder &{ConfigFile:default.conf SvrAddr:<nil> BackupAddrList:[] Arg1: Compress:{Loop:99 Profile: Skip:false NoFlag: DryRun:{} ZipFolder:{FolderName:folder1 ArchiveName:out.zip CreationTime:2030-06-01 13:01:00 +0000 UTC} ZipFile:{FileName:defaultzip.file ArchiveName:}} Extract:{InputFile: OutputFolder:}}
100+ zipfolder &{ConfigFile:default.conf SvrAddr:<nil> BackupAddrList:[1.1.1.1 2.2.2.2] FloatList:[1.7 2.2 3.3] StrList:[a bb ccc] Compress:{Loop:99 Profile: Skip:false NoFlag: DryRun:{} ZipFolder:{FolderName:folder1 ArchiveName:out.zip CreationTime:2030-06-01 13:01:00 +0000 UTC} ZipFile:{FileName:defaultzip.file ArchiveName:}} Extract:{InputFile: OutputFolder:}}
96101```
97102
98103
@@ -117,32 +122,36 @@ Base:
117122- string
118123- bool
119124
120- provided by ` github.com/hujun-open/myflags/v2/types ` :
125+ following are provided by ` github.com/hujun-open/myflags/v2/types ` :
121126
122127- all int/uint types: support ` base ` tag for the base
123128- net.HardwareAddr
124129- net.IPNet
125130- net.IP
126131- time.Time
127132- time.Duration
128- - all int/uint types
129133
130134Others:
131135- All types implement both of following interface:
132- - ` encoding.TextUnmarshaler `
136+ - ` encoding.TextMarshaler `
133137 - ` encoding.TextUnmarshaler `
134138- All type register via ` myflags.Register ` function
135139
136140Note: flag is only created for exported struct field.
137141
142+ ### Slice / Array
138143
139144In addition to above types, following types are also supported:
140145
141146- pointer to the type above
142147- slice/array of type above
143148- slice/array of pointer to the type above
144149
145- for slice/array, use "," as separator.
150+ Use "," as separator of items in the input string
151+
152+ note: if the item type is struct, then it must be either registered type or implements ` encoding.TextMarshaler ` /` encoding.TextUnmarshaler `
153+
154+ ### Nested / Embeded struct
146155
147156myflags also supports following type of struct:
148157
0 commit comments