1. 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
  2. 05 8月, 2017 4 次提交
  3. 27 7月, 2017 8 次提交
    • B
      Add some tests for the time flags · 06157fde
      Benjamin Sago 提交于
      Apparently I forgot to give the --time flag an argument, and this wasn’t actually covered by any of the xtests! Well, it’s tested now.
      
      I’m not sure how to handle multiple --time arguments.
      06157fde
    • B
      Add tests for size format · 817c7d23
      Benjamin Sago 提交于
      817c7d23
    • 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
      Streamline parser tests · 45e1cb77
      Benjamin Sago 提交于
      45e1cb77
    • 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. 23 7月, 2017 1 次提交
  6. 13 7月, 2017 9 次提交
  7. 12 7月, 2017 1 次提交
  8. 10 7月, 2017 3 次提交
    • B
      Merge branch 'file-namers' · f54bc417
      Benjamin Sago 提交于
      This creates a new type that holds file extensions in preparation for #116. It doesn’t do anything yet, but it will!
      f54bc417
    • B
      Get the list of file extensions from the Options · c29170e3
      Benjamin Sago 提交于
      The FileExtensions in the FileName is now a reference to the one in the original FileStyle, which gets put there in the options module.
      
      This allows the extensions to be derived from the user, somehow, in the future when that part’s done.
      c29170e3
    • B
      Reify file extensions · 0d8d7234
      Benjamin Sago 提交于
      Instead of having a File do its own extension checking, create a new type that takes a file and checks *that*. This new type (FileExtensions) is currently empty, but were it to contain values, those values could be used to determine the file’s colour.
      0d8d7234
  9. 08 7月, 2017 2 次提交
    • B
      Make not showing paths in link targets the default · bfa65b3b
      Benjamin Sago 提交于
      This commit replaces the “two normal cases” of showing a link’s target or not with “one default and one special case” of preferring to hide them, displaying the link targets by setting a flag instead.
      
      Doing this simplifies the file name constructor, which gets to remove an argument.
      bfa65b3b
    • B
      Replace FileName::new with a factory · 0d613652
      Benjamin Sago 提交于
      The new FileStyles value will contain all the fields necessary to “style” a file’s name. Right now this is only the Classify field, but there can be more later. The benefit of this is that when we add more, we won’t need to update all the places where file names are displayed.
      0d613652
  10. 07 7月, 2017 2 次提交
  11. 06 7月, 2017 7 次提交