@@ -69,19 +69,16 @@ Visit https://www.paperboy.email/ to learn more.
6969)
7070
7171var  newCmd  =  & cobra.Command {
72- 	Use :   "new [path]" ,
73- 	Short : "Create new content for a campaign" ,
74- 	Long :  `A longer description...` ,
72+ 	Use :     "new [path]" ,
73+ 	Short :   "Create new content for a campaign" ,
74+ 	Example : "paperboy new the-announcement.md" ,
75+ 	Args :    cobra .ExactArgs (1 ),
7576	RunE : func (cmd  * cobra.Command , args  []string ) error  {
7677		cfg , err  :=  config .LoadConfig ()
7778		if  err  !=  nil  {
7879			return  err 
7980		}
8081
81- 		if  len (args ) <  1  {
82- 			return  newUserError ("please provide a path" )
83- 		}
84- 
8582		path  :=  cfg .AppFs .ContentPath (args [0 ])
8683		return  writeTemplate (cfg .AppFs , path , contentTemplate , map [string ]string {
8784			"Date" :    time .Now ().Format (time .RFC3339 ),
@@ -91,19 +88,16 @@ var newCmd = &cobra.Command{
9188}
9289
9390var  newListCmd  =  & cobra.Command {
94- 	Use :   "list [path]" ,
95- 	Short : "Create a new recipient list" ,
96- 	Long :  `A longer description...` ,
91+ 	Use :     "list [path]" ,
92+ 	Short :   "Create a new recipient list" ,
93+ 	Example : "paperboy new list in-the-know" ,
94+ 	Args :    cobra .ExactArgs (1 ),
9795	RunE : func (cmd  * cobra.Command , args  []string ) error  {
9896		cfg , err  :=  config .LoadConfig ()
9997		if  err  !=  nil  {
10098			return  err 
10199		}
102100
103- 		if  len (args ) <  1  {
104- 			return  newUserError ("please provide a path" )
105- 		}
106- 
107101		path  :=  cfg .AppFs .ListPath (args [0 ])
108102		return  writeTemplate (cfg .AppFs , path , listTemplate , nil , false )
109103	},
@@ -112,7 +106,7 @@ var newListCmd = &cobra.Command{
112106var  newProjectCmd  =  & cobra.Command {
113107	Use :   "project [path]" ,
114108	Short : "Create new project directory" ,
115- 	Long :  `A longer description...` ,
109+ 	Args :  cobra . RangeArgs ( 0 ,  1 ) ,
116110	RunE : func (cmd  * cobra.Command , args  []string ) error  {
117111		path  :=  "." 
118112		if  len (args ) >  0  {
0 commit comments