Commit graph

9 commits

Author SHA1 Message Date
Charles LeDoux
4d1167ffd7 Parse cli and stowrc files separately
Why:

* We want to selectively apply expansion to:
    * Only options from stowrc files.
    * Only options that take a path.
* This requires ability to:
    * Differentiate cli options from stowrc options
    * Distinguish between individual stowrc options.

This change addresses the need by:

* Options from ARGV and stowrc files are separately parsed, resulting in
  two options hashes.
    * Creating an option hash from stowrc files allows modification of
      specific arguments without having to rely on something like regex
      parsing of the options.

* get_config_file_options modified to return options hash.
    * Uses the same parse_options function that parses ARGV

* Add Hash:Merge to dependencies in order to merge the two option
  hashes.

* process_options() merges the two option hashes.
    * Get option hash for ARGV
    * Get option hash from get_config_file_options().
    * Merge the two hashes with Hash::Merge.
    * Sanitation and checks are ran on the merged options.

* The options -S, -D, and -R are ignored in stowrc files.
    * Due to the way argument parsing happens, the effect of these
      actions is not carried from stowrc into parsing of cli options.
    * It doesn't seem to make sense to put these options in stowrc
      anyway.
2019-06-25 19:38:25 +01:00
Adam Spiers
f24de47b82 add IO::Scalar to build_requires 2015-11-13 12:05:42 +00:00
Adam Spiers
6e5331814d Fix some incorrect CPAN meta-data about the project. 2011-12-15 21:14:07 +00:00
Adam Spiers
1f35c6c94f Automate check for 'use lib' line in bin/stow. 2011-12-11 13:16:03 +00:00
Adam Spiers
d6d51a7883 chkstow was missing from Module::Build install. 2011-12-06 17:11:12 +00:00
Adam Spiers
51b1bd3958 File::Slurp is no longer used. 2011-12-06 17:11:12 +00:00
Adam Spiers
bbaace4d5a Fix automake issues (thanks to Stefano Lattarini for spotting these!) 2011-12-06 17:11:12 +00:00
Adam Spiers
59fa7ae4a6 Add build-time dependencies on Test::More and Test::Output. 2011-11-26 15:10:27 +00:00
Adam Spiers
58625800ee Reorganise more files into subdirectories and add CPAN support via Module::Build 2011-11-26 15:10:26 +00:00