@@ -40,19 +40,20 @@ func main() {
40
40
}
41
41
runtime .GOMAXPROCS (int (maxProcs ))
42
42
43
- command .On ("diff" , drive .DescDiff , & diffCmd {}, []string {})
44
- command .On ("init" , drive .DescInit , & initCmd {}, []string {})
45
- command .On ("list" , drive .DescList , & listCmd {}, []string {})
46
- command .On ("pull" , drive .DescPull , & pullCmd {}, []string {})
47
- command .On ("push" , drive .DescPush , & pushCmd {}, []string {})
48
- command .On ("pub" , drive .DescPublish , & publishCmd {}, []string {})
49
- command .On ("emptytrash" , drive .DescEmptyTrash , & emptyTrashCmd {}, []string {})
50
- command .On ("help" , drive .DescHelp , & helpCmd {}, []string {})
51
- command .On ("quota" , drive .DescQuota , & quotaCmd {}, []string {})
52
- command .On ("trash" , drive .DescTrash , & trashCmd {}, []string {})
53
- command .On ("untrash" , drive .DescUntrash , & untrashCmd {}, []string {})
54
- command .On ("unpub" , drive .DescUnpublish , & unpublishCmd {}, []string {})
55
- command .On ("version" , drive .Version , & versionCmd {}, []string {})
43
+ command .On (drive .DiffKey , drive .DescDiff , & diffCmd {}, []string {})
44
+ command .On (drive .EmptyTrashKey , drive .DescEmptyTrash , & emptyTrashCmd {}, []string {})
45
+ command .On (drive .InitKey , drive .DescInit , & initCmd {}, []string {})
46
+ command .On (drive .HelpKey , drive .DescHelp , & helpCmd {}, []string {})
47
+ command .On (drive .ListKey , drive .DescList , & listCmd {}, []string {})
48
+ command .On (drive .PullKey , drive .DescPull , & pullCmd {}, []string {})
49
+ command .On (drive .PushKey , drive .DescPush , & pushCmd {}, []string {})
50
+ command .On (drive .PubKey , drive .DescPublish , & publishCmd {}, []string {})
51
+ command .On (drive .QuotaKey , drive .DescQuota , & quotaCmd {}, []string {})
52
+ command .On (drive .TouchKey , drive .DescTouch , & touchCmd {}, []string {})
53
+ command .On (drive .TrashKey , drive .DescTrash , & trashCmd {}, []string {})
54
+ command .On (drive .UntrashKey , drive .DescUntrash , & untrashCmd {}, []string {})
55
+ command .On (drive .UnpubKey , drive .DescUnpublish , & unpublishCmd {}, []string {})
56
+ command .On (drive .VersionKey , drive .Version , & versionCmd {}, []string {})
56
57
command .ParseAndRun ()
57
58
}
58
59
@@ -281,6 +282,30 @@ func (cmd *pushCmd) Run(args []string) {
281
282
}
282
283
}
283
284
285
+ type touchCmd struct {
286
+ hidden * bool
287
+ noPrompt * bool
288
+ recursive * bool
289
+ }
290
+
291
+ func (cmd * touchCmd ) Flags (fs * flag.FlagSet ) * flag.FlagSet {
292
+ cmd .hidden = fs .Bool ("hidden" , false , "allows pushing of hidden paths" )
293
+ cmd .recursive = fs .Bool ("r" , true , "performs the push action recursively" )
294
+ cmd .noPrompt = fs .Bool ("no-prompt" , false , "shows no prompt before applying the push action" )
295
+ return fs
296
+ }
297
+
298
+ func (cmd * touchCmd ) Run (args []string ) {
299
+ sources , context , path := preprocessArgs (args )
300
+ exitWithError (drive .New (context , & drive.Options {
301
+ Hidden : * cmd .hidden ,
302
+ NoPrompt : * cmd .noPrompt ,
303
+ Path : path ,
304
+ Recursive : * cmd .recursive ,
305
+ Sources : sources ,
306
+ }).Touch ())
307
+ }
308
+
284
309
func pushMounted (cmd * pushCmd , args []string ) {
285
310
argc := len (args )
286
311
0 commit comments