1. 07 8月, 2017 1 次提交
    • B
      Give IgnorePatterns a better interface · c1e20666
      Benjamin Sago 提交于
      This commit gives IgnorePatterns a bunch of constructor methods that mean its option-parsing sister file doesn’t need to know that it’s a vec of glob patterns inside: it can work with anything that iterates over strings. Now, the options module doesn’t need to know about the glob crate.
      c1e20666
  2. 06 8月, 2017 2 次提交
    • B
      Separate the matched flags from the free strings · 9872eba8
      Benjamin Sago 提交于
      Originally, both the matched flags and the list of free strings were returned from the parsing function and then passed around to every type that had a ‘deduce’ method. This worked, but the list of free strings was carried around with it, never used.
      
      Now, only the flags are passed around. They’re in a new struct which has the methods the Matches had.
      
      Both of Matches’s fields are now just data, and all of the methods on MatchedFlags don’t ignore any fields, so it’s more cohesive, at least I think that’s the word.
      
      Building up the MatchedFlags is a bit more annoying though because the vector is now hidden behind a field.
      9872eba8
    • B
      Document and organise the parser module · 0456e7cf
      Benjamin Sago 提交于
      0456e7cf
  3. 27 7月, 2017 5 次提交
    • B
      Add test for ignoring globs · adca0d36
      Benjamin Sago 提交于
      adca0d36
    • B
      Fix --tree --all · a2cd39e0
      Benjamin Sago 提交于
      Fixes #193. --all was treated the same as --all --all; now it’s treated differently.
      a2cd39e0
    • B
      Add tests for dot filters · 08315736
      Benjamin Sago 提交于
      08315736
    • B
      Add tests for sort field · bc5c0194
      Benjamin Sago 提交于
      **
      bc5c0194
    • B
      Switch to the new options parser · 2d1f462b
      Benjamin Sago 提交于
      This commit removes the dependency on the ‘getopts’ crate entirely, and re-writes all its uses to use the new options parser instead.
      
      As expected there are casualties galore:
      
      - We now need to collect the options into a vector at the start, so we can use references to them, knowing they’ll be stored *somewhere*.
      - Because OsString isn’t Display, its Debug impl gets used instead. (This is hopefully temporary)
      - Options that take values (such as ‘sort’ or ‘time-style’) now parse those values with ‘to_string_lossy’. The ‘lossy’ part means “I’m at a loss for what to do here”
      - Error messages got a lot worse, but “--tree --all --all” is now a special case of error rather than just another Misfire::Useless.
      - Some tests had to be re-written to deal with the fact that the parser works with references.
      - ParseError loses its lifetime and owns its contents, to avoid having to attach <'a> to Misfire.
      - The parser now takes an iterator instead of a slice.
      - OsStrings can’t be ‘match’ patterns, so the code devolves to using long Eq chains instead.
      - Make a change to the xtest that assumed an input argument with invalid UTF-8 in was always an error to stderr, when that now in fact works!
      - Fix a bug in Vagrant where ‘exa’ and ‘rexa’ didn’t properly escape filenames with spaces in.
      2d1f462b
  4. 24 7月, 2017 1 次提交
    • B
      Move filter and dir_action from options to fs · 5b1966d2
      Benjamin Sago 提交于
      This commit moves the definitions of Filter and DirAction from the options module to the fs module, but leaves the parts that actually have to do with option parsing alone.
      
      Now, the options module shouldn’t define any types that get used elsewhere in the program: it only adds functionality to types that already exist.
      5b1966d2
  5. 29 6月, 2017 2 次提交
    • B
      Add sorting by type · f7505364
      Benjamin Sago 提交于
      This isn’t perfect, as a file’s type isn’t cached, so it gets recomputed for every comparison in the sort! We can’t go off the file’s `st_mode` flag because it’s not guaranteed to be in any order between systems.
      f7505364
    • B
      Forbid --tree --all --all · 340bccbc
      Benjamin Sago 提交于
      There’s a problem with the tree view where it’ll still recurse through `.` and `..`. But if you were using tree view, would you even need to see them? They’d be in the tree already!
      340bccbc
  6. 27 6月, 2017 3 次提交
    • B
      Implement . and .. by inserting them maually · 20793ce7
      Benjamin Sago 提交于
      I originally thought that the entries . and .. were in *every* directory entry, and exa was already doing something to filter it out. And then... I could find no such code! Turns out, if we want those entries present, we have to insert them ourselves.
      
      This was harder than expected. Because the file filter doesn’t have access to the parent directory path, it can’t “filter” the files vector by inserting the files at the beginning.
      
      Instead, we do it at the iterator level. A directory can be scanned in three different ways depending on what sort of dotfiles, if any, are wanted. At this point, we already have access to the parent directory’s path, so we can just insert them manually. The enum got moved to the dir module because it’s used most there.
      20793ce7
    • B
      Allow passing in the --all option more than once · 39fd9059
      Benjamin Sago 提交于
      39fd9059
    • B
      Move the show-invisibles flag into a struct · 5ace1264
      Benjamin Sago 提交于
      5ace1264
  7. 24 6月, 2017 1 次提交
  8. 27 3月, 2017 1 次提交
  9. 30 10月, 2016 2 次提交
    • B
      Basic glob ignoring · 95596297
      Ben S 提交于
      See #97 and recently #130 too.
      
      This allows the user to pass in options such as "--ignore '*.pyc'" to not list any files ending in '.pyc' in the output. It uses the Rust glob crate and currently does a simple split on pipe, without any escaping, so it’s not really *complete*, but is at least something.
      95596297
    • B
      Make the views non-Copy · a6712994
      Ben S 提交于
      This has to be done for when ignore patterns get introduced and have to be stored in a Vec.
      a6712994
  10. 29 8月, 2016 1 次提交
    • B
      Add legal values to error messages · 7e15e0dd
      Brandon W Maister 提交于
      Now when you do `--sort time` instead of saying "unknown option --sort
      time" it will say "unknown options '--sort time' (choices: name...)"
      with all legal options.
      
      This also adds the legal values to the default help text.
      7e15e0dd
  11. 11 6月, 2016 1 次提交
  12. 18 4月, 2016 1 次提交
    • B
      Split up the options module · e9e1161c
      Benjamin Sago 提交于
      The original options was becoming a bit unwieldy, and would have been even more so if I added the same amount of comments. So this commit splits it up.
      
      There's no extra hiding going on here, or rearranging things within the module: (almost) everything now has to be marked 'pub' to let other sub-modules in the new options module to see it.
      e9e1161c