Boost logo

Boost :

From: Llew Sion Goodstadt (leo.goodstadt_at_[hidden])
Date: 2004-09-15 09:34:13


> > I could get something like: "-f filename (=STDIN) :"
> instead of "-f
> > arg (=STDIN) :"?
>
> No, it's not possible at the moment. Since its not a
> showstopper, I'd like
> to take some time to think about it. The typed_value class is
> getting too
> big...
Surely this would not be greatly affected by something like:

    class typed_value
    ...
    {
    public:
      std::string arg_name;
        typed_value* arg_name(const std::string& arg_name_)
        {
            arg_name = arg_name_;
            return this;
        }

   ...

and

    template<class T, class charT>
    std::string
    typed_value<T, charT>::name() const
    {
        std::string arg_name_ = arg_name;
        if (!arg_name_.length())
           arg_name_ = arg;
        if (!m_default_value.empty() && !m_default_value_as_text.empty()) {
            return arg_name_ + " (=" + m_default_value_as_text + ")";
        } else {
            return arg_name_;
        }
    }

which would be used as
> > value<Infile>(&forests_file)->default_value(default_in,"STDIN")

value<Infile>(&forests_file)->default_value(default_in)->arg_name("STDIN")


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk