"Thompson, David" <dthomps...@worcester.edu> writes: > On Wed, Aug 19, 2015 at 4:27 AM, Amirouche Boubekki > <amirou...@hypermove.net> wrote: > >> What about dispatch `guix package -i` depending on the argument. In >> principle there will be no "*.scm$" packages so the above could be >> >> guix package -i package.scm >> >> The idea behind that is to keep the number of command to minimum. In this >> case, IMO, it makes sens to merge both logic inside the same UI. > > That won't work because it creates ambiguities in the package spec > syntax. How can one tell if a package spec or a file name was passed > with 100% accuracy? You can't, and we'd have to use a heuristic that > would surely fail in some awful way for someone. It's best for this > to be a separate argument. > > - Dave
Sometimes a 99.9% solution is acceptable IMO. Packages named "foo.scm" should be exceedingly rare in first place, and then if you also have a file of that name in the current directory... Another option might be to expect a slash in the string, i.e. forcing "./" if the file's in the current directory: guix package -i ./package.scm Happening to have a package with a slash in its name, ending in .scm, and coinciding with the relative or absolute path of a file existing on your filesystem, ought to be implausible. Just my two cents from glancing over the discussion though. No strong opinions. Additional flag is fine too by me. Taylan