Skip to content

Commit

Permalink
Check difficulty argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Apr 20, 2024
1 parent 506dec4 commit c545937
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/create/create.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ proc create*(conf: Conf) =
let msg = &"Both --approach and --article were provided. Please specify only one."
stderr.writeLine msg
quit QuitFailure
if conf.action.difficulty > 0:
let msg = "The difficulty argument is not supported for approaches"
stderr.writeLine msg
quit QuitFailure
let trackConfigPath = conf.trackDir / "config.json"
let trackConfig = parseFile(trackConfigPath, TrackConfig)
let trackExerciseSlugs = getSlugs(trackConfig.exercises, conf, trackConfigPath)
Expand All @@ -36,6 +40,10 @@ proc create*(conf: Conf) =
let msg = "Please specify an exercise to create an article for, using --exercise <slug>"
stderr.writeLine msg
quit QuitFailure
if conf.action.difficulty > 0:
let msg = "The difficulty argument is not supported for approaches"
stderr.writeLine msg
quit QuitFailure
let trackConfigPath = conf.trackDir / "config.json"
let trackConfig = parseFile(trackConfigPath, TrackConfig)
let trackExerciseSlugs = getSlugs(trackConfig.exercises, conf, trackConfigPath)
Expand Down

0 comments on commit c545937

Please sign in to comment.