-
Duncan Coutts authored
Extend TargetSelector with a TargetAllPackages constructor with the corresponding concrete command line syntax 'all'. The interpretation of this is extended for all commands to be the same as if the list of all packages local to the project were given. Since the concrete syntax for the meta-target 'all' can in principle clash with a package 'all' or a component 'all', this short form of syntax is made to be ambigious with the existing short forms for packages or components, and new more qualified forms are added. This means that a user writing 'cabal build all' in a project where there is a local package 'all' or a component 'all' in the package in the cwd (but not any package 'all' as a dependency or any component 'all' in any package other than the one in the cwd), will be informed that the syntax is ambigious and will be told the more qualified forms of the possible targets. These would be ':all' and 'pkg:all'. The use of the usual ':' separator with an empty string is the explicit indicator of a meta namespace. Since 'pkg:all' itself is also potentially ambigious with a package named 'pkg' containing a component 'all' then there is a further qualified form ':pkg:all' to select the package named 'all'. This more qualified syntax need only be used in these highly unusual ambigious cases and the user will be informed. The intention, as has been the case previously, is to allow a normal syntax that is short and convenient but potentially ambigious in rare cases, while still allowing all cases to be expressed unambigiously.
df8ccce1