Skip to content

Commit

Permalink
Case by case
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Jun 27, 2023
1 parent a00a9b2 commit c28b1bb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/cmd/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ func tuiCmd() *cobra.Command {
blocks = sortBlocks(blocks)

if len(blocks) == 0 {
return errors.Errorf("no code blocks in %s", fFileName)
if fFileMode {
return errors.Errorf("no code blocks in %s", fFileName)
}
if !fAllowUnnamed {
return errors.Errorf("no named code blocks, consider adding flag --allow-unnamed")
}
return errors.Errorf("no named code blocks")
}

if visibleEntries <= 0 {
Expand Down

0 comments on commit c28b1bb

Please sign in to comment.