-
Notifications
You must be signed in to change notification settings - Fork 14
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
jshn.sh: add convenience functions, cleanup #6
base: master
Are you sure you want to change the base?
Conversation
f10a21a
to
104f923
Compare
@nbd168 Can I get a review please? I need some of these changes to help with a migration from ISC-DHCP to Kea. |
@jow- Can you please look this over? |
Most (all?) existing functions use reference style returns (caller passes a destination variable name, function populates it and uses it's numeric return value to signify success/error) while your new functions introduce echo style returns requiring calling code to use ugly subshell invocations. Personally I would also change the naming like that:
|
Thanks, making those changes now. By And Where do the functions
For instance, you could implement
if |
104f923
to
02b2c90
Compare
Casting a wider net cc: @blogic |
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Creating 2nd PR (#12) without the positioning getter/setting commit which seems to be stalled. |
@jow- I believe I've made these changes as requested. Can you please re-review? |
02b2c90
to
3ba2872
Compare
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
3ba2872
to
d1f6263
Compare
You might not always want to populate JSON serially, so a way to save/restore the cursor through a convenience function is handy.
Also, adding anonymous (unnamed) strings to an array isn't obvious, so added a convenience function for that.
Lastly, some minor cleanup to show what the parameters are to functions, etc.