Comments (7)
This seems reasonable, here are my thoughts:
- Multi-var values should be passed directly on the stack instead of via a list reference.
- The options controlling the behaviour of
set
should be the first argument after'key'
. - Add an
unset
method instead of passingundef
toset
.unset
should return the value(s) that was set. - I would implement the existing
str
,int
andbool
in terms ofset
andunset
. - I would define constants for the "type" i.e.
type => 'str'
would becomeGit::Raw::Config->STRING
from p5-git-raw.
I'm not really a fan of putting the options directly after the key. If you wouldn't use the options, you would get something like set('foo', {}, 'value')
which doesn't look nice, or undef instead of {}.
from p5-git-raw.
The other way to do it is to make it the (optional) first parameter to set
.
from p5-git-raw.
I am curious about why you want this, it has the same rather inconsistent API. The options are optional and aren't needed per se to set the value. So why they come first is something I do not understand.
from p5-git-raw.
I want any key
and value
s to be adjacent, so that the following works:
my @keyAndValue = ('key', 'value');
$config->set ({options1 => 1}, @keyAndValue);
If the optional options
argument slices key
and value
the above won't work.
from p5-git-raw.
I guess you could also make it work by putting the options last. It actually doesn't matter that much...
from p5-git-raw.
Feel free to make it the last argument.
from p5-git-raw.
Related Issues (20)
- Add support for commit trailers HOT 4
- -m32 option makes build fail on most 32 bit arches HOT 4
- please make convenience copy of libgit2 et all identifyable HOT 2
- rev-parse support is missing HOT 9
- ppport.h:4594: warning: "WIDEST_UTYPE" redefined HOT 1
- Getting a [-Wstringop-truncation] warning in Walker.xs
- Error during dzil test
- Provide Makefile.PL / cpanfile in git repo HOT 3
- Request: support enumeration and traversal of submodules HOT 6
- Refspec issue with patterns, HOT 4
- libssh2 deprecated in Redhat 7 HOT 2
- Git::Raw::Graph()->is_descendant_of doesn't propagate error codes HOT 1
- Unable to install Git::Raw on AIX 7.2 HOT 1
- Test failure with libgit2-dev 1.3.0 HOT 9
- There are various CVEs for embedded libraries HOT 5
- main vs master HOT 1
- SIGSEGV in test suite
- amending a commit
- does not compile on windows with latest strawberry perl HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5-git-raw.