File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,8 +51,11 @@ func Submit(ctx *cli.Context) {
5151 log .Printf ("file name: %s" , filename )
5252 }
5353
54- if isTest (filename ) {
55- log .Fatal ("Please submit the solution, not the test file." )
54+ if isTest (filename ) && ! ctx .Bool ("test" ) {
55+ log .Fatal ("You're trying to submit a test file. If this is really what " +
56+ "you want, please pass the --test flag to exercism submit." )
57+ } else if ! isTest (filename ) && ctx .Bool ("test" ) {
58+ log .Fatal ("You've passed the --test flag but you're not submitting a test file." )
5659 }
5760
5861 file , err := filepath .Abs (filename )
Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ func main() {
121121 ShortName : "s" ,
122122 Usage : descSubmit ,
123123 Action : cmd .Submit ,
124+ Flags : []cli.Flag {
125+ cli.BoolFlag {
126+ Name : "test" ,
127+ Usage : "submit a test file" ,
128+ },
129+ },
124130 },
125131 {
126132 Name : "unsubmit" ,
You can’t perform that action at this time.
0 commit comments