File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -1539,26 +1539,28 @@ namespace po {
1539
1539
return m_type;
1540
1540
}
1541
1541
1542
- option& single ( ) {
1543
- PROGRAMOPTIONS_ASSERT ( ( m_multi == false ) || ( m_fallback == nullptr && m_data == nullptr && m_callbacks.empty () ),
1544
- " single () must be set prior to: fallback(), callback(), parsing" );
1542
+ option& multi ( bool make_multi ) {
1543
+ PROGRAMOPTIONS_ASSERT ( ( m_multi == make_multi ) || ( m_fallback == nullptr && m_data == nullptr && m_callbacks.empty () ),
1544
+ " multi () must be set prior to: fallback(), callback(), parsing" );
1545
1545
mutable_operation ();
1546
- m_multi = false ;
1546
+ m_multi = make_multi ;
1547
1547
return *this ;
1548
1548
}
1549
+ option& single ( bool make_single ) {
1550
+ return multi ( !make_single );
1551
+ }
1549
1552
option& multi () {
1550
- PROGRAMOPTIONS_ASSERT ( ( m_multi == true ) || ( m_fallback == nullptr && m_data == nullptr && m_callbacks.empty () ),
1551
- " multi() must be set prior to: fallback(), callback(), parsing" );
1552
- mutable_operation ();
1553
- m_multi = true ;
1554
- return *this ;
1553
+ return multi ( true );
1555
1554
}
1556
- bool is_single () const {
1557
- return ! is_multi ( );
1555
+ option& single () {
1556
+ return single ( true );
1558
1557
}
1559
1558
bool is_multi () const {
1560
1559
return m_multi;
1561
1560
}
1561
+ bool is_single () const {
1562
+ return !is_multi ();
1563
+ }
1562
1564
1563
1565
private:
1564
1566
template < typename T >
You can’t perform that action at this time.
0 commit comments