Skip to content

Add support for filenames as argument for XPCLI #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thekid opened this issue Oct 17, 2011 · 1 comment
Closed

Add support for filenames as argument for XPCLI #133

thekid opened this issue Oct 17, 2011 · 1 comment

Comments

@thekid
Copy link
Member

thekid commented Oct 17, 2011

Scope of Change

As with the "unittest" command, the xpcli-Runner will also accept
filenames as class names.

Rationale

  • Use of tab-completion
  • Consistency with "unittest"

Functionality

The util.cmd.Runner class will check for the first argument containing
the string ".class.php" (or actually, whatever xp::CLASS_FILE_EXT
constant is defined for), and then try to find the class in the classpath.

To run a Command class, you can use the following:

  # Use class name
  $ xpcli fully.qualified.ClassName

  # Use filename
  $ xpcli fully/qualified/ClassName.class.php

Note

Using filenames only works if classes are found in the classpath,
otherwise there is no way to infer the classname from the file's name!

Security considerations

n/a

Speed impact

  • Slightly slower: One strstr() check for ".class.php" for every case

Dependencies

n/a

Related documents

@thekid thekid closed this as completed Oct 17, 2011
@thekid
Copy link
Member Author

thekid commented Oct 17, 2011

Implementing patch also contains a couple of bugfixes:

  • Markup from method apidocs not correctly textified
  • Duplicate @args-check removal
  • Positional args numbering off by one in error message
  • @Args selection not respected in error message

friebe, Sun, 29 Jul 2007 15:49:00 +0200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant