@@ -37,9 +37,11 @@ contains |
| 37 | 37 | logical, intent(out) :: show_all, interactive |
| 38 | 38 | integer :: i, nargs |
| 39 | 39 | character(len=256) :: arg |
| 40 | + logical :: print_only |
| 40 | 41 | |
| 41 | 42 | show_all = .false. |
| 42 | | - interactive = .false. |
| 43 | + interactive = .true. ! Interactive is now the default |
| 44 | + print_only = .false. |
| 43 | 45 | nargs = command_argument_count() |
| 44 | 46 | |
| 45 | 47 | do i = 1, nargs |
@@ -54,12 +56,19 @@ contains |
| 54 | 56 | show_all = .true. |
| 55 | 57 | else if (trim(arg) == '-i' .or. trim(arg) == '--interactive') then |
| 56 | 58 | interactive = .true. |
| 59 | + else if (trim(arg) == '-p' .or. trim(arg) == '--print') then |
| 60 | + print_only = .true. |
| 57 | 61 | else |
| 58 | 62 | print '(A)', 'Error: Unknown option: ' // trim(arg) |
| 59 | 63 | print '(A)', 'Run ''fuss --help'' for usage information' |
| 60 | 64 | stop 1 |
| 61 | 65 | end if |
| 62 | 66 | end do |
| 67 | + |
| 68 | + ! If print_only is set, disable interactive mode |
| 69 | + if (print_only) then |
| 70 | + interactive = .false. |
| 71 | + end if |
| 63 | 72 | end subroutine parse_arguments |
| 64 | 73 | |
| 65 | 74 | subroutine print_version() |
@@ -78,7 +87,7 @@ contains |
| 78 | 87 | print '(A)', 'OPTIONS:' |
| 79 | 88 | print '(A)', ' -h, --help Show this' |
| 80 | 89 | print '(A)', ' -v, --version Show version' |
| 81 | | - print '(A)', ' -i Interactive mode (default)' |
| 90 | + print '(A)', ' -p, --print Print tree and exit (non-interactive)' |
| 82 | 91 | print '(A)', ' -a, --all Show all files, not just dirty' |
| 83 | 92 | print '(A)', '' |
| 84 | 93 | print '(A)', 'KEYS:' |